{% extends "base_blank.volt" %}

{% block pageFooter%}
    <script type="text/javascript">
        var bpId = {{ id }};
        var domainPic = '{{ this.di.get('appConfig').application.domainPic }}';
        var urlEditorPT = '{{ url.get('tools/editorPT') }}';
        var urlPbServiceList = '{{ url.get('bpservice/list') }}';
    </script>
    {{ javascript_include("/assets/manage/js/editor_pt_view.js", false) }}
    {{ javascript_include("/libs/UEditor/utf8-php/ueditor.config.js", false) }}
    {{ javascript_include("/libs/UEditor/utf8-php/ueditor.all.min.js", false) }}
    {{ javascript_include("/libs/UEditor/utf8-php/lang/zh-cn/zh-cn.js", false) }}
    {{ javascript_include("/assets/manage/js/bp/addService.js", false) }}
    <script>
    UE.getEditor('editor');
    </script>
{% endblock %}

{% block content %}

<div class="container-fluid" id="content_box_blank">
    <div class="row">
        <div class="col-xs-12">
            <ol class="breadcrumb">
                <li>美容院管理</li>
                <li class="active">添加美容院服务项目</li>
                <li class="active pull-right"><a href="{{ url.get('bpservice/list', ['id': id]) }}" class="btn btn-primary btn-xs"><i class="fa fa-chevron-left"></i> 返回</a></li>
            </ol>

            <form id="form_add" class="form-horizontal" role="form" method="post" action="" target="ifr_send_file" enctype="multipart/form-data">
                <input type="hidden" name="callback" value="parent.setFormResult">
                <input type="hidden" name="beauty_parlor_id" value="{{ id }}">
                <div class="form-group">
                    <label for="service_name" class="col-xs-2 control-label">服务名称</label>
                    <div class="col-xs-9">
                        <input type="text" class="form-control" id="service_name" name="service_name" data-rule="required;">
                    </div>
                </div>
                <div class="form-group">
                    <label for="service_cover" class="col-xs-2 control-label">封面</label>
                    <div class="col-xs-9">
                        <input type="file" class="form-control" id="bp_cover" name="bp_cover" data-rule="required;">
                        <p class="help-block">*支持JPG，PNG，JPEG格式的图片，大小不超过1M，尺寸为：750X350px</p>
                    </div>
                </div>
<!--                <div class="form-group">
                    <label for="service_description" class="col-xs-2 control-label">服务简介</label>
                    <div class="col-xs-9">
                        <input type="text" class="form-control" id="service_description" name="service_description" data-rule="required;">
                    </div>
                </div>-->
                <div class="form-group">
                    <label for="service_price" class="col-xs-2 control-label">价格</label>
                    <div class="col-xs-2">
                        <div class="input-group">
                            <input type="text" class="form-control" id="service_price" name="service_price" data-rule="required;decimal;" data-target="#service_price_error">
                            <div class="input-group-addon">元</div>
                        </div>
                    </div>
                    <div class="col-xs-7">
                        <div id="service_price_error"></div>
                    </div>
                </div>
                <div class="form-group">
                    <label for="service_unit" class="col-xs-2 control-label">规格</label>
                    <div class="col-xs-2">
                        <input type="text" class="form-control" id="service_unit" name="service_unit">
                    </div>
                    <div class="col-xs-7">
                        <p class="help-block pull-left">* 如为1疗程，则填写1疗程；如为10次，则填写10次</p>
                    </div>
                </div>

                <div class="form-group">
                    <label for="service_is_sell" class="col-xs-2 control-label">项目状态</label>
                    <div class="col-xs-9">
                        <div class="radio">
                            <label>
                                <input type="radio" name="service_is_sell" id="service_is_sell_1" value="1" checked="checked"> 在售
                            </label>
                            <label>
                                <input type="radio" name="service_is_sell" id="service_is_sell_0" value="0"> 下架
                            </label>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label for="service_intro" class="col-xs-2 control-label">详细介绍</label>
                    <div class="col-xs-9">
                        <!-- <div id="box_intro_view" class="hide"></div>
                        <input type="hidden" class="form-control" id="service_intro" name="service_intro" data-rule="required;" data-target="#service_intro_error">
                        <button type="button" class="btn btn-primary btn-sm" id="but_intro_add"><i class="fa fa-plus"></i> 添 加</button>
                        <button type="button" class="btn btn-primary btn-sm hide" id="but_intro_update"><i class="fa fa-pencil"></i> 修 改</button> -->
                        <textarea id="editor" data-rule="required;" name="service_intro" style="width:800px; height:400px;"></textarea>
                        <!-- <div class="input-group" id="service_intro_error"></div> -->
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-xs-12 text-center">
                        <button type="submit" class="btn btn-primary"><i class="fa fa-floppy-o fa-lg"></i> 保 存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{% endblock %}